from django.urls import path,re_path
from goods.views import IndexView, DetailView, ListView

urlpatterns = [
    path('index', IndexView.as_view(), name='index'), # 首页/index
    # 详情页,接收一个参数(数字)，取名为goods_id传给对应视图.如:/goods/1
    re_path(r'^goods/(?P<goods_id>d+$)', DetailView.as_view(), name='detail'),
    re_path(r'^list/(?P<type_id>\d+)/(?P<page>\d+)$', ListView.as_view(), name='list'), # 列表页
    path('', IndexView.as_view(), name='index'), # 列表页
]
